import * as Taro from "@tarojs/taro";
class Files {
    constructor() {
    }
    /**
     * 选择文件
     * @param type              文件类型，默认 file
     * @param count             个数，默认1个
     * @param extension         限制扩展名
     */
    choose(type, count, extension) {
        return new Promise((resolve, reject) => {
            Taro.chooseMessageFile({
                type: type !== null && type !== void 0 ? type : 'file',
                count: count !== null && count !== void 0 ? count : 1,
                extension,
                success: (files) => {
                    console.log('files', files);
                    return resolve(files);
                },
                fail: (err) => {
                    reject(err);
                }
            }).then();
        });
    }
}
const files = new Files();
export default files;
